package core;

import java.awt.Color;
import java.util.Hashtable;



/**
 * A player, local or over the network.
 * 
 * @author CodyS
 * 
 */
public abstract class Player {
	private Game g;

	
	public Player(Game g) {
		this.g = g;
	}

	public Game getGame() {
		return g;
	}

	/**
	 * Tell the player to leave.
	 */
	public abstract void leave();

	/**
	 * Call this to notify the player that the game has started.
	 */
	public abstract void started();

	/**
	 * Notify the player that he should decide if he is ready or not.
	 */
	public abstract void ready();

	/**
	 * Tells the player that it is his turn and that he should go do something.
	 */
	public abstract void doTurn();

	/**
	 * returns whether it is the players turn
	 */
	public abstract boolean isTurn();
	
	/**
	 * Notify a player that someone else wants to do a trade
	 * @param offer What the player (host of trade) is offering
	 * @param ret What the player (host of trade) wants back
	 */
	public abstract void notifyTrade(Hashtable<ResourceType, Integer> offer,
			Hashtable<ResourceType, Integer> ret);

	/**
	 * Notify the player that the game has new 
	 */
	public abstract void updateGameState();
	/**
	 * Notify the player that they have to move the robber somewhere.
	 * @param loc
	 */
	public abstract void notifyRobber();
	/**
	 * Notify the player that they have to steal a resource
	 */
	public abstract void notifySteal();
	/**
	 * Notify a player that they have to choose some cards to lose because
	 * they have more than 7
	 */
	public abstract void loseCards();
	/**
	 * Get the amount of some resource
	 * @param rt
	 * @return
	 */
	public abstract int amount(ResourceType rt);
	/**
	 * Add some amount of a resource to the player
	 * @param rt
	 * @param number
	 */
	public abstract void addResource(ResourceType rt, int number);
	/**
	 * Remove some resources from the player.
	 * @param rt
	 * @param number
	 */
	public abstract void removeResoruce(ResourceType rt, int number);
	/**
	 * Get the total amount of resources that a player has.
	 * @return
	 */

	public abstract int totalResources();
	/**
	 * Adds a card to the player's hand
	 * @param c
	 */
	public abstract void addCard(Card c);
	/**
	 * Remove a card from the player's hand.
	 * @param c
	 */
	public abstract void removeCard(Card c);
	/**
	 * returns total number of cards in players hand
	 */
	public abstract int getTotalCards();
	/**
	 * returns color of player for houses & roads & scoreboard
	 */
	public abstract Color getColor();
	/**
	 * returns name of player
	 */
	public abstract String getName();
	/**
	 * returns Victory Points
	 */
	public abstract int getVictoryPoints();
	/**
	 * returns number of armies
	 */
	public abstract int getArmies();
	/**
	 * returns length of longest road
	 */
	public abstract int getRoadLength();
	/**
	 * returns whether player has longest road
	 */
	public abstract boolean hasLongestRoad();
	/**
	 * returns whether player has largest army
	 */
	public abstract boolean hasLargestArmy();
	/**
	 * returns number of houses that player has remaining to build
	 */
	public abstract int getHousesLeft();
	/**
	 * returns number of roads that player has remaining to build
	 */
	public abstract int getRoadsLeft();
	/**
	 * returns number of cities that player has remaining to build
	 */
	public abstract int getCitiesLeft();

	public abstract int getResources(ResourceType resource);
	
	public abstract void notifyDiscard(int discard);
	
}